package framework.objects;

import framework.GameConfig;


public abstract class DynamicGameObject extends GameObject implements Updateable {
	
	public DynamicGameObject() {
		super();
	}
	
	public float getX() {
		return x;
	}

	public void setX(float x) {
		this.x = x;
	}

	public float getY() {
		return y;
	}

	public void setY(float y) {
		this.y = y;
	}
	
	public void onRemove() {
		//
	}
	
	protected void leaveInWorld(float dx, float dy) {
		if (x > GameConfig.BASE_WIDTH - dx) x = GameConfig.BASE_WIDTH - dx;
		if (x < dx) x = dx;
		if (y > GameConfig.BASE_HEIGHT - dy) y = GameConfig.BASE_HEIGHT - dy;
		if (y < dy) y = dy;
	}

}
